<template>
  <div>
    子组件：{{countRef}}
    <el-button @click="addCount">count++</el-button>
  </div>
</template>
<script setup>
/*defineProps({
  countRef: {
    type: Number,
    default: 0
  }
})*/
import { reactive, toRef, toRefs } from 'vue'

const countRef = toRef(reactive({count:0}),'count')

const emit = defineEmits(['countChange'])

const addCount = () => {
  countRef.value++
  emit('countChange',countRef.value)
}

</script>

<style scoped>

</style>
